package ycl.important.common.base.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import ycl.important.common.base.entity.BaseSelectOneEntity;

/**
 * 只查看一个数据的数据库层
 *
 * @author: YCL
 * @date: 2021-08-23 20:34:05
 */
@Mapper
@Repository
public interface BaseSelectOneMapper<T extends BaseSelectOneEntity>
		extends BaseDao<T> {

	/**
	 * 查询该表的一条数据
	 *
	 * @param tableName 传入表名
	 * @return 本表的唯一一条数据
	 */
	@Select("select * from ${name} limit 1")
	T getOne(@Param("name") String tableName);
}
